<?php
class Session {
  
  public $lifeTime;
  public $memcache;

  function __construct() {
    $this->memcache = DB::getMCH();
  }

  function mcsession_open($savePath, $sessName) {
    return $this->lifeTime = get_cfg_var("session.gc_maxlifetime") * 10;
  }

  function mcsession_close() {
    return $this->mcsession_gc(ini_get('session.gc_maxlifetime') * 10);
  }

  function mcsession_read($sessID) {
      return $this->memcache->get($sessID);
  }

  function mcsession_write($sessID,$sessData) {
      return $this->memcache->set($sessID, $sessData, false, $this->lifeTime);
  }

  function mcsession_destroy($sessID) {
      //return $this->memcache->delete($sessID);
  }

  function mcsession_gc($sessMaxLifeTime) {
  }

}
?>